package com.situ.mianXiangDuiXiang.entity;

public class CardObj {

    private Integer cardNo;
    private Double money;

    public CardObj() {
        this.cardNo= (int)(Math.random()*1000000+100000);
    }

    public CardObj(Integer cardNo, Double money) {
        this.cardNo = cardNo;
        this.money = money;
    }

    public Integer getCardNo() {
        return cardNo;
    }

    public void setCardNo(Integer cardNo) {
        this.cardNo = cardNo;
    }

    public Double getMoney() {
        return money;
    }

    public void setMoney(Double money) {
        this.money = money;
    }

    @Override
    public String toString() {
        return "CardObj{" +
                "cardNo=" + cardNo +
                ", money=" + money +
                '}';
    }

    public void cunQian(Double money){
        this.money+=money;
    }

    public void quQian(Double money){
        this.money-=money;
    }
    public void chaQian(){
        System.out.println(this.money);
    }
    public void updateMoney(CardObj card ,Double money){
        this.money-=money;
        card.setMoney(card.money+money);
    }

}
